package com.agile.leetcode.comparator;

import lombok.Data;
import lombok.ToString;

/**
 * @Author:ChenZhangKun
 * @Date: 2022/11/6 15:11
 */
@Data
@ToString
public class Person implements Comparable<Person> {
    private String name;
    private Integer age;
    @Override
    public int compareTo(Person o) {
        return this.getAge()-o.getAge();
    }

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }
}
